<template>
  <div id="app">
    <NewHeaderVue v-bind="{ one: 'hello', two: 'World' }" />
    <!-- 多个props传参时  -->
    <StudentsVue :name="王远" :age="18" :sex="男" />
    <!-- ref获取dom对象 -->
    <p ref="haha">{{ msg }}}</p>
    <button @click="getDom">点击获取dom对象</button>
  </div>
</template>

<script>
import NewHeaderVue from "./components/NewHeader.vue";
import StudentsVue from "./components/Students.vue";
export default {
  name: "App",
  // 注册
  components: { NewHeaderVue, StudentsVue },
  data() {
    return {
      msg: "欢迎学习",
    };
  },
  methods: {
    getDom() {
      // 添加一个ref标识 就可以直接找到这个dom对象
      console.log(this.$refs.haha);
    },
  },
};
</script>
<!-- scoped 该样式只会在当前使用 -->
<style scoped>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}
</style>
